package cn.good.yan;

import cn.good.yan.pojo.Bill;
import cn.good.yan.pojo.Sales;
import cn.good.yan.pojo.User;
import cn.good.yan.service.BillService;
import cn.good.yan.service.SalesService;
import cn.good.yan.service.UserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;


/**
 * 测试 1
 *  1 测试 多数据源
 * @author shengren.yan
 * @create 2023-09-23
 */
@SpringBootTest
public class test1 {

    @Autowired
    private SalesService salesService;

    @Autowired
    private BillService billService;

    @Autowired
    private UserService userService;

    /**
     * 1 测试 多数据源
     */
    @Test
    public void test1() {
        // 数据源1 - 查询
        Sales sales = salesService.getById(1L);
        System.out.println(sales);
        System.out.println("---------------------------------");
        // 数据源2 - 查询
        Bill bill = billService.getById(1L);
        System.out.println("---------------------------------");
        System.out.println(bill);
        // 数据源3 - 查询
        List<User> list = userService.list();
        System.out.println("---------------------------------");
        System.out.println(list);


    }


}
